package com.kangzhili.nettypush.dto;

import lombok.Data;

/**
 * WebSocket请求消息通用结构
 * @param <T> 消息体数据类型
 */
@Data
public class RequestBody<T> {
    /**
     * 消息类型/操作码
     */
    private int code;
    /**
     * 用户ID
     */
    private String userId;
    /**
     * 消息体数据
     */
    private T data;

    public RequestBody() {}

    public RequestBody(int code, String userId, T data) {
        this.code = code;
        this.userId = userId;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
} 